//package com.fir.my.batis.plus.until;
//
//import com.alibaba.fastjson.JSONObject;
//
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileReader;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.Arrays;
//import java.util.List;
//
//public class ReadTxtFile {
//    public static void readTxt(String path){
//        try {
////            File file = new File("D:\\analysis-2.txt");
//            File file = new File(path + "\\analysis-2.txt");
//            FileReader fileReader = new FileReader(file);
//            BufferedReader bufferedReader = new BufferedReader(fileReader);
//            String line;
//            while ((line = bufferedReader.readLine()) != null) {
//                System.out.println(line);
//                String jsonStr = getJsonStr(line);
////                ChuanKou.sendStr("COM5",jsonStr);
//            }
//            bufferedReader.close();
//        } catch (IOException e) {
//            System.out.println("解析txt报错！！！");
//            e.printStackTrace();
//        }
//    }
//
//
//    public static String getJsonStr(String lineStr) {
////        System.out.println("2023-12-14 09:36:59/灰铁/Fe/测量样品/铸铁-类型曲线/".length());
////        System.out.println(";;0898;1;23;".length());
//        String s = lineStr;//; "2023-12-14 09:36:59/灰铁/Fe/测量样品/铸铁-类型曲线/C,3.8458;Si,2.3749;Mn,0.5643;P,0.0247;S,0.0356;Cr,0.1349;Cu,0.0276;Ti,0.0232;Mg,0.0003;La,0.0031;Ce,0.0024;Ni,0.0134;Mo,0.0158;Co,0.0000;Pb,0.0039;Al,0.0018;V,0.0000;B,0.0042;Nb,0.0071;Sb,0.0000;Bi,0.0072;" +
////                "Zn,0.0053;Sn,0.0033;W,0.0000;As,0.0073;RE,0.0054;Fe,92.8940;;0898;1;23;";
//        String head = s.substring(0,39);
//        System.out.println(head);
//        String time = head.substring(0,19);
//        System.out.println(time);
//        String type = head.substring(20,22);
//        System.out.println(type);
//        String chuns = s.substring(39,s.length() - 12);
//        List<String> json = new ArrayList<>(Arrays.asList(chuns.replaceAll(",", ":").split(";")));
//        System.out.println(json.toString());
//        json.add("type:'" + type+"'");
//        json.add("time:'" + time+"'");
//        System.out.println(json.toString());
//        String jsonMap = json.toString().replaceAll("\\[","{").replaceAll("\\]","}");
//        Object parse = JSONObject.parse(jsonMap);//ckeck
//        System.out.println(parse.toString());
//        return jsonMap;
//
//    }
//
//
//}
